package net.lucamasini.ricette.client;

import net.lucamasini.ricette.client.ingredienti.IngredientiServiceBroker;
import net.lucamasini.ricette.client.ingredienti.event.RefreshListaIngredientiEvent;
import net.lucamasini.ricette.client.tipoingredienti.TipoIngredientiServiceBroker;
import net.lucamasini.ricette.client.tipoingredienti.event.RefreshListaTipoIngredientiEvent;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;

public class ServiceBus {

	private final static EventBus eventBus = new SimpleEventBus();

	public static EventBus getEventbus() {
		return eventBus;
	}
	
	public static void registerEventHandlers() {
		getEventbus().addHandler(RefreshListaIngredientiEvent.TYPE, new IngredientiServiceBroker());
		getEventbus().addHandler(RefreshListaTipoIngredientiEvent.TYPE, new TipoIngredientiServiceBroker());
	}
}
